package rad.framework.mda.generator.template.main.webapp;

import org.eclipse.uml2.uml.Class;
import rad.framework.mda.generator.util.*;

public class Search
{
  protected static String nl;
  public static synchronized Search create(String lineSeparator)
  {
    nl = lineSeparator;
    Search result = new Search();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"" + NL + "\txmlns:ui=\"http://java.sun.com/jsf/facelets\"" + NL + "\ttemplate=\"#{theme.search}\">" + NL + "" + NL + "\t<ui:param name=\"finder\" value=\"#{";
  protected final String TEXT_2 = "Finder}\" />" + NL + "\t<ui:param name=\"editor\" value=\"#{";
  protected final String TEXT_3 = "Editor}\" />" + NL + "" + NL + "</ui:composition>";
  protected final String TEXT_4 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    

    Class uml2Class = (Class) argument;
    String uncapClassName = NameHelper.getUncapName(uml2Class);
    String capClassName = NameHelper.getCapName(uml2Class);
    stringBuffer.append(TEXT_1);
    stringBuffer.append(uncapClassName);
    stringBuffer.append(TEXT_2);
    stringBuffer.append(uncapClassName);
    stringBuffer.append(TEXT_3);
    stringBuffer.append(TEXT_4);
    return stringBuffer.toString();
  }
}
